package com.linkhub.oms.common.exception;


import com.linkhub.oms.common.enums.ResponseCodeEnum;

/**
 * @Description: ResponseCode
 * @Author: echo
 * @Date: 2024/3/2 22:29
 * @Version: 1.0
 */
public abstract class BaseException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    private String errCode;

    public BaseException(String errMessage) {
        super(errMessage);
    }

    public BaseException(String errCode, String errMessage) {
        super(errMessage);
        this.errCode = errCode;
    }

    public BaseException(String errMessage, Throwable e) {
        super(errMessage, e);
    }

    public BaseException(String errCode, String errMessage, Throwable e) {
        super(errMessage, e);
        this.errCode = errCode;
    }

    public BaseException(ResponseCodeEnum resultCodeEnum) {
        super(resultCodeEnum.getMsg());
        this.errCode = resultCodeEnum.getCode();
    }

    public BaseException(ResponseCodeEnum resultCodeEnum, String errMessage) {
        super(errMessage);
        this.errCode = resultCodeEnum.getCode();
    }

    public String getErrCode() {
        return errCode;
    }

    public void setErrCode(String errCode) {
        this.errCode = errCode;
    }

}
